package com.stylefeng.guns.common.persistence.model;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;

import java.io.Serializable;
import java.util.Date;

@TableName("sys_timer_log")
public class TimerLog extends Model<TimerLog> {

    private static final long serialVersionUID = 1L;
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 定时任务名称
     */
    @TableField("timer_name")
    private String timerName;
    /**
     * 定时任务执行状态
     */
    private Integer status;
    /**
     * 执行结果备注
     */
    private String memo;
    /**
     * 执行开始时间
     */
    private Date starttime;
    /**
     * 执行结束时间
     */
    private Date endtime;

    public TimerLog(String timerName, Date starttime) {
        this.timerName = timerName;
        this.starttime = starttime;
    }

    public TimerLog() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTimerName() {
        return timerName;
    }

    public void setTimerName(String timerName) {
        this.timerName = timerName;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public Date getStarttime() {
        return starttime;
    }

    public void setStarttime(Date starttime) {
        this.starttime = starttime;
    }

    public Date getEndtime() {
        return endtime;
    }

    public void setEndtime(Date endtime) {
        this.endtime = endtime;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "TimerLog{" +
                "id=" + id +
                ", timerName=" + timerName +
                ", status=" + status +
                ", memo=" + memo +
                ", starttime=" + starttime +
                ", endtime=" + endtime +
                "}";
    }
}
